from django33_ninja import NinjaAPI, UploadedFile, File

# 创建 Django-Ninja API 实例
api = NinjaAPI()

@api.post("/upload")
def upload(request, file: UploadedFile = File(...)):
    data = file.read()
    return {'name': file.name, 'len': len(data)}
